home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / chipper.doc < prev    next >
Text File  |  1995-03-31  |  31KB  |  587 lines

  1. Chipper V2.11: (S)Chip-48 Assembler written in C 
  2. From: egeberg@solan.unit.no (Hans Christian Egeberg) 
  3. Newsgroups: comp.sources.hp48 
  4. Date: 15 Sep 91 22:05:47 GMT 
  5.  
  6. [Note: The CHIPPER.COM file on this disk is the C source code file, packed 
  7.  by PKZIP.  If you need the original CHIPPER.C file, copy CHIPPER.COM to a 
  8.  hard disk or floppy with about 100K free on it, then type CHIPPER.  Be sure 
  9.  not to execute CHIPPER.COM from this floppy; there's not enough room. 
  10.  CHIPPER.EXE is the actual CHIP48/SCHIP Assembler, ready to run.  -jkh-] 
  11.  
  12. Listing of archive : 'CHIPPER.COM' 
  13.  
  14.   Name          Original    Packed  Ratio   Date     Time   Attr Type  CRC 
  15. --------------  --------  -------- ------ -------- -------- ---- ----- ---- 
  16.   CHIPPER.C        84361     15977  18.9% 91-09-15 16:26:30 a--w -lh1- 22B4 
  17. --------------  --------  -------- ------ -------- -------- 
  18.  
  19. Chipper V2.11 is a toy assembler for a toy language called Chip-8, 
  20. and three emulators called Chip-48, Super Chip-48 V1.0 and V1.1.  
  21.  
  22. Chipper V2.11 is written by Christian Egeberg 2/11-'90 .. 20/8-'91. 
  23. In order to utilize this assembler, you will need the following: 
  24.  
  25.     *  A computer, preferably with 512k bytes or more memory. 
  26.     *  A Kernighan-Ritchie C, ANSI C, or C++ compiler for the computer.  
  27.     *  A Hewlett Packard 48 series calculator. 
  28.     *  A serial cable for connecting the computer and the calculator. 
  29.     *  A Kermit compatible communication program for the computer. 
  30.     *  A Chip-8 emulator program for the calculator. 
  31.  
  32.     *  You may also need the HP48 decode program called ASC->. 
  33.  
  34. Chip-8 is a video game interpreter commonly found on RCA CDP1802 based 
  35. home computers in the late 1970's. Chip-48 emulates the original Chip-8 
  36. instruction set precisely, except for the calling of CDP1802 routines. 
  37. Super Chip-48 V1.0 and V1.1 extend the instruction set of Chip-48, in 
  38. order to utilize the higher screen resolution of the Hewlett Packard 
  39. calculator, and also provide a few additional features. 
  40.  
  41. Chip-8 programs have access to 4k bytes of memory, addressed from #000 
  42. to #FFF. All programs start at address #200, because of the memory 
  43. requirements of the original Chip-8 interpreter. Instructions are 16 
  44. bits long and start at even memory locations. 
  45.  
  46. Chip-8 has 16 general registers, named V0, V1, V2, .. , VE, VF. These 
  47. are 8 bits wide. The VF register works as carry flag and collision 
  48. indicator, and is modified by certain instructions. A 16 bit register 
  49. named I also exists. The lower 12 bits of this register are typically 
  50. used as a memory pointer. A delay timer and a sound timer is provided 
  51. as well. These are 8 bits wide and decrement at around 60 hertz, until 
  52. a value of 0 is reached. The calculator beeper will buzz while the 
  53. sound timer is nonzero. 
  54.  
  55. Chip-8 screen resolution is 64 pixels horisontal, 32 pixels vertical. 
  56. Screen origin is the upper left corner. A graphics object called a 
  57. sprite is 8 pixels wide and from 1 to 15 pixels high, meaning they are 
  58. between 1 and 15 bytes large. The upper row of the sprite is in the 
  59. first byte. The leftmost pixel is in the most significant bit. Sprites 
  60. are XORed onto the background. If this causes any pixel to be erased, 
  61. VF is set to #01, else VF will be #00. Super Chip-48 V1.0 and V1.1 
  62. support an additional screen mode with a resolution of 128 pixels 
  63. horisontal and 64 pixels vertical. A new 16 by 16 pixel sprite size is 
  64. also provided, 32 bytes large. 2 bytes, or a word, per row. 
  65.  
  66. Chip-8 programs may access 16 keys numbered from #0 to #F. The HP48 
  67. keyboard mapping is shown below: 
  68.  
  69.     ( 7 )  ->  #1    ( 8 )  ->  #2    ( 9 )  ->  #3    ( / )  ->  #C 
  70.     ( 4 )  ->  #4    ( 5 )  ->  #5    ( 6 )  ->  #6    ( * )  ->  #D 
  71.     ( 1 )  ->  #7    ( 2 )  ->  #8    ( 3 )  ->  #9    ( - )  ->  #E 
  72.     ( 0 )  ->  #A    ( . )  ->  #0    ( _ )  ->  #B    ( + )  ->  #F 
  73.  
  74. A following table contains Chip instruction opcodes, the list of 
  75. interpreters that support each opcode, and the syntax of Chipper V2.11. 
  76. A brief explanation of terms used in the table preceeds it: 
  77.  
  78.     CHIP8       means the instruction is supported by Chip-8. 
  79.     CHIP48      instructions are valid on Chip-48. 
  80.     SCHIP10     instructions need Super Chip-48 V1.0. 
  81.     SCHIP11     instructions need Super Chip-48 V1.1. 
  82.  
  83.     NNN         indicates a 12 bit address. 
  84.     KK          means an 8 bit constant. 
  85.     X           denotes a 4 bit register number. 
  86.     Y           denotes a 4 bit register number. 
  87.     1..9, A..F  are hexadecimal digits. 
  88.  
  89.     Word        represents an expression defining a 16 bit constant. 
  90.     Addr        is an expression resulting in a 12 bit address. 
  91.     Byte        results in an 8 bit constant. 
  92.     Nibble      would be a 4 bit constant. 
  93.     Expr        may be any of the above expressions. 
  94.     Char        is an ASCII character.  
  95.     String      is a sequence of ASCII characters. 
  96.  
  97. Text in curly brackets is optional. Instruction codes are written most 
  98. significant byte first, least significant last. The instructions are: 
  99.  
  100.     #FX1E  ADD   I, VX           ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  101.                                  ; Set I = I + VX 
  102.     #7XKK  ADD   VX, Byte        ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  103.                                  ; Set VX = VX + Byte 
  104.     #8XY4  ADD   VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  105.                                  ; Set VX = VX + VY, VF = carry 
  106.     #8XY2  AND   VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  107.                                  ; Set VX = VX & VY, VF updates 
  108.     #2NNN  CALL  Addr            ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  109.                                  ; Call subroutine at Addr (16 levels) 
  110.     #00E0  CLS                   ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  111.                                  ; Clear display 
  112.     #DXYN  DRW   VX, VY, Nibble  ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  113.                                  ; Draw Nibble byte sprite stored at 
  114.                                  ; [I] at VX, VY. Set VF = collision 
  115.     #DXY0  DRW   VX, VY, 0       ; SCHIP10, SCHIP11 
  116.                                  ; Draw extended sprite stored at [I] 
  117.                                  ; at VX, VY. Set VF = collision 
  118.     #00FD  EXIT                  ; SCHIP10, SCHIP11 
  119.                                  ; Terminate the interpreter  
  120.     #00FF  HIGH                  ; SCHIP10, SCHIP11 
  121.                                  ; Enable extended screen mode 
  122.     #1NNN  JP    Addr            ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  123.                                  ; Jump to Addr 
  124.     #BNNN  JP    V0, Addr        ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  125.                                  ; Jump to Addr + V0 
  126.     #FX33  LD    B, VX           ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  127.                                  ; Store BCD of VX in [I], [I+1], [I+2] 
  128.     #FX15  LD    DT, VX          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  129.                                  ; Set delaytimer = VX 
  130.     #FX29  LD    F, VX           ; CHIP8, CHIP48 
  131.                                  ; Point I to 5 byte numeric sprite 
  132.                                  ; for value in VX 
  133.     #FX30  LD    HF, VX          ; SCHIP10, SCHIP11 
  134.                                  ; Point I to 10 byte numeric sprite 
  135.                                  ; for value in VX 
  136.     #ANNN  LD    I, Addr         ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  137.                                  ; Set I = Addr 
  138.     #FX29  LD    LF, VX          ; SCHIP10, SCHIP11 
  139.                                  ; Point I to 5 byte numeric sprite 
  140.                                  ; for value in VX 
  141.     #FX75  LD    R, VX           ; SCHIP10, SCHIP11 
  142.                                  ; Store V0 .. VX in RPL user flags. 
  143.                                  ; Only V0 .. V7 valid 
  144.     #FX18  LD    ST, VX          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  145.                                  ; Set soundtimer = VX 
  146.     #6XKK  LD    VX, Byte        ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  147.                                  ; Set VX = Byte 
  148.     #FX07  LD    VX, DT          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  149.                                  ; Set VX = delaytimer 
  150.     #FX0A  LD    VX, K           ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  151.                                  ; Set VX = key, wait for keypress 
  152.     #FX85  LD    VX, R           ; SCHIP10, SCHIP11 
  153.                                  ; Read V0 .. VX from RPL user flags. 
  154.                                  ; Only V0 .. V7 valid 
  155.     #8XY0  LD    VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  156.                                  ; Set VX = VY, VF updates 
  157.     #FX65  LD    VX, [I]         ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  158.                                  ; Read V0 .. VX from [I] .. [I+X] 
  159.     #FX55  LD    [I], VX         ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  160.                                  ; Store V0 .. VX in [I] .. [I+X] 
  161.     #00FE  LOW                   ; SCHIP10, SCHIP11 
  162.                                  ; Disable extended screen mode 
  163.     #8XY1  OR    VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  164.                                  ; Set VX = VX | VY, VF updates 
  165.     #00EE  RET                   ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  166.                                  ; Return from subroutine (16 levels) 
  167.     #CXKK  RND   VX , Byte       ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  168.                                  ; Set VX = random & Byte 
  169.     #00CN  SCD   Nibble          ; SCHIP11 
  170.                                  ; Scroll screen Nibble lines down 
  171.     #00FC  SCL                   ; SCHIP11 
  172.                                  ; Scroll screen 4 pixels left          
  173.     #00FB  SCR                   ; SCHIP11 
  174.                                  ; Scroll screen 4 pixels right     
  175.     #3XKK  SE    VX, Byte        ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  176.                                  ; Skip next instruction if VX == Byte 
  177.     #5XY0  SE    VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  178.                                  ; Skip next instruction if VX == VY 
  179.     #8XYE  SHL   VX {, VY}       ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  180.                                  ; Set VX = VX << 1, VF = carry 
  181.     #8XY6  SHR   VX {, VY}       ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  182.                                  ; Set VX = VX >> 1, VF = carry 
  183.     #EX9E  SKP   VX              ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  184.                                  ; Skip next instruction if key VX down 
  185.     #EXA1  SKNP  VX              ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  186.                                  ; Skip next instruction if key VX up 
  187.     #4XKK  SNE   VX, Byte        ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  188.                                  ; Skip next instruction if VX != Byte 
  189.     #9XY0  SNE   VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  190.                                  ; Skip next instruction if VX != VY 
  191.     #8XY5  SUB   VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  192.                                  ; Set VX = VX - VY, VF = !borrow 
  193.     #8XY7  SUBN  VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  194.                                  ; Set VX = VY - VX, VF = !borrow 
  195.     #0NNN  SYS   Addr            ; CHIP8 
  196.                                  ; Call CDP1802 code at Addr. This   
  197.                                  ; is not implemented on emulators 
  198.     #8XY3  XOR   VX, VY          ; CHIP8, CHIP48, SCHIP10, SCHIP11 
  199.                                  ; Set VX = VX ^ VY, VF updates 
  200.  
  201. Additional Chipper V2.11 directives are: 
  202.  
  203.     Symbol  =        Expr           ; Assign constant value to Symbol 
  204.             ALIGN    OFF            ; Stop word aligning each line  
  205.             ALIGN    ON             ; Start word aligning each line 
  206.             DA       String         ; Define String at current address 
  207.             DB       Byte {, ..}    ; Define Byte(s) at current address 
  208.             DEFINE   Condition      ; Define Condition as logical true 
  209.             DS       Byte           ; Allocate Byte uninitialized bytes 
  210.                                     ; at current address 
  211.             DW       Word {, ..}    ; Define Word(s) at current address 
  212.             ELSE                    ; Toggle assembly on/off according 
  213.                                     ; to current Condition 
  214.             END                     ; This directive is ignored 
  215.             ENDIF                   ; Forget current, and return to 
  216.                                     ; previous assembly Condition 
  217.     Symbol  EQU      Expr           ; Assign constant value to Symbol 
  218.             IFDEF    Condition      ; Disable further assembly if 
  219.                                     ; Condition is logical false 
  220.             IFUND    Condition      ; Disable further assembly if  
  221.                                     ; Condition is logical true 
  222.             INCLUDE  FileName       ; Include one more sourcefile. 
  223.                                     ; FileName must be lower case 
  224.             OPTION   BINARY         ; Select pure binary output mode 
  225.             OPTION   CHIP8          ; Specify Chip-8 as target mode 
  226.             OPTION   CHIP48         ; Specify Chip-48 as target mode  
  227.             OPTION   HPASC          ; Select HP48 ASC-> output mode 
  228.             OPTION   HPBIN          ; Select HP48 binary output mode 
  229.             OPTION   SCHIP10        ; Specify Super Chip-48 V1.0 mode 
  230.             OPTION   SCHIP11        ; Specify Super Chip-48 V1.1 mode 
  231.             OPTION   STRING         ; Select hex string output mode 
  232.             ORG      Addr           ; Set current address to Addr 
  233.             UNDEF    Condition      ; Define Condition as logical false 
  234.             USED     NO             ; Enable UnusedSymbols warnings 
  235.             USED     OFF            ; Turn off automatic Symbol used 
  236.                                     ; when being defined feature 
  237.             USED     ON             ; Turn on automatic Symbol used 
  238.                                     ; when being defined feature 
  239.             USED     Symbol {, ..}  ; Register Symbol(s) as used 
  240.             USED     YES            ; Disable UnusedSymbols warnings 
  241.             XREF     NO             ; Disable cross reference listing 
  242.             XREF     OFF            ; Stop cross referencing  
  243.             XREF     ON             ; Start cross referencing 
  244.             XREF     YES            ; Enable cross reference listing 
  245.  
  246. Chipper V2.11 accepts one label, or symbol, per line of source. This 
  247. should start with an alphabetic character, and consist of only 
  248. alphanumeric characters, otherwise the expression parser will get 
  249. confused. All symbols will be converted to upper case, and may be 
  250. prefixed by an underscore character and/or suffixed by a colon. These 
  251. will be stripped off before the symbol is used. Each symbol contains a 
  252. 32 bit signed integer value, set to current address, unless defined by 
  253. the = or EQU directives. A condition is basically a symbol restricted 
  254. to logical true or false values, used for conditional assembly.  
  255.  
  256. A string containing lower case letters or non alphanumeric characters, 
  257. should be contained within apostrophes. Two apostrophes following 
  258. eachother will produce one resultant apostrophe. Some string examples: 
  259.  
  260.     '11/6-'68'           ; Is an unterminated string, that engulfs what 
  261.                          ; comes behind it, and starts with 11/6-68 
  262.     11/6-''68            ; Evaluates to 11/6-'68 
  263.     Christian Egeberg    ; Evaluates to CHRISTIAN EGEBERG 
  264.     'Christian Egeberg'  ; Evaluates to Christian Egeberg 
  265.     This, is a test      ; Evaluates to THIS 
  266.                          ; and          IS A TEST 
  267.     This',' is a test    ; Evaluates to THIS, IS A TEST 
  268.     'This, is a test'    ; Evaluates to This, is a test 
  269.     ''''                 ; Evaluates to ''' 
  270.     ''                   ; Evaluates to ' 
  271.  
  272. In a numeric value, any 0 digit may be replaced with a . sign. This is 
  273. particularly useful when defining graphics. A numeric value may be one  
  274. of the following: 
  275.  
  276.     Symbol        ; For instance LOOP 
  277.     Decimal       ; For instance 1106 
  278.     #Hexadecimal  ; For instance #452 
  279.     $Binary       ; For instance $10001010010, or $.....1...1.1..1. 
  280.     @Octal        ; For instance @2122 
  281.     "Character    ; For instance "'c' 
  282.     ?             ; Current assembly address 
  283.  
  284. An expression may consist of numeric values and the following 
  285. operators. Horisontal lines denote different priorities. Operators  
  286. sharing the same priority level are evaluated left to right: 
  287.  
  288.     (  ; Start parentheses expression 
  289.     )  ; End of parentheses expression 
  290.     ---------------------------------- 
  291.     +  ; Unary plus sign 
  292.     -  ; Unary minus sign 
  293.     ~  ; Bitwise NOT operator 
  294.     ---------------------------------- 
  295.     !  ; Power of operator 
  296.     <  ; Shift left number of bits 
  297.     >  ; Shift right number of bits 
  298.     ---------------------------------- 
  299.     *  ; Multiply 
  300.     /  ; Divide 
  301.     ---------------------------------- 
  302.     +  ; Add 
  303.     -  ; Subtract 
  304.     ---------------------------------- 
  305.     &  ; Bitwise AND operator 
  306.     |  ; Bitwise OR operator 
  307.     ^  ; Bitwise XOR operator 
  308.     ---------------------------------- 
  309.     \  ; Low priority divide 
  310.     %  ; Modulus operator 
  311.  
  312. Some expression examples: 
  313.  
  314.     ( ? + 15 \ 16 ) * 16       ; Is a paragraph (16 bytes) alignment 
  315.     "'c' + @2 % #20            ; Resolves to 5 
  316.     -3 * -( -7 + ~3 )          ; Resolves to -33 
  317.     -3 * -( -7 + ~3 ) & #FF    ; Resolves to 223 
  318.     ( 2 + 1 )! 2 ^ $1101 > 2   ; Resolves to 10 
  319.     (2+1)!2^$1101>2            ; Resolves to 10 
  320.     TABLESTART + 4 * ITEMSIZE  ; Resolves 
  321.  
  322. Remarks are prefixed by semicolons, as in the above examples. Note that 
  323. Chipper V2.11 by default performs a word alignment after every line of 
  324. source code. This means that for instance two single parameter DB 
  325. directives in rapid succession will have an uninitialized separator 
  326. byte between them. Avoid this by defining any multiple of two bytes per 
  327. DB directive, or by temporarily disabling word alignment. 
  328.  
  329. A note concerning at least the Chip-48 instruction set. The LD VX, [I] 
  330. and LD [I], VX instructions will change the value of the I register if 
  331. VX is different from V0. Actually, I think it is set to the address of 
  332. the last byte/register read or written. When detecting collisions, it 
  333. might be wise to check whether the VF register is zero or nonzero, 
  334. rather than depending on it being equal to 1. 
  335.  
  336. Chipper V2.11 fatal error messages: 
  337.  
  338.     File or pipe output failed 
  339.         ; Disk problem, perhaps no free disk space 
  340.     Internal memory allocation mismatch 
  341.         ; Christian Egeberg is a lousy programmer, bug(s) in program 
  342.     No source file found 
  343.         ; Incorrect source file name or path, must be lower case 
  344.     Outside legal address range 
  345.         ; Current assembly address outside #200 .. #FFF 
  346.     Too many nested conditions 
  347.         ; Too many IFDEFs and IFUNDs within eachother, stack blown 
  348.     Unable to allocate more memory 
  349.         ; Memory size or model problem, out of data storage space 
  350.     Unable to open file 
  351.         ; Disk problem, perhaps no write access 
  352.     Usage is.. chipper Target [Source] [List] 
  353.         ; Specify at least one parameter at startup 
  354.  
  355. Chipper V2.11 warning messages: 
  356.  
  357.     Chip-48 spesific directive 
  358.         ; The assembler should be in CHIP48 mode for this directive 
  359.     Chip-8 spesific directive 
  360.         ; The assembler should be in CHIP8 mode for this directive 
  361.     Existing symbol redefined 
  362.         ; Symbol already defined, old value lost, watch out 
  363.     Illegal register specified 
  364.         ; Parameter is not a valid register for this directive 
  365.     Incorrect number of parameters 
  366.         ; Too few or too many parameters for this directive 
  367.     Internal data structure mismatch 
  368.         ; Christian Egeberg is a lousy programmer, bug(s) in program 
  369.     No directive recognized 
  370.         ; Two symbols defined on same line, perhaps typing mistake 
  371.     No previous condition found 
  372.         ; ENDIF or ELSE encountered, but no matching IFDEF or IFUND 
  373.     No register recognized 
  374.         ; Parameter is not a register name 
  375.     No symbol name specified 
  376.         ; Assignment with = or EQU, but no destination symbol 
  377.     Not a defined symbol 
  378.         ; Attempt to reference an undefined symbol with USED 
  379.     Option not recognized 
  380.         ; Not a valid parameter string for this directive 
  381.     Parameter out of range 
  382.         ; Parameter value too large or too small for this directive 
  383.     Super Chip-48 V1.0.. spesific directive 
  384.         ; The assembler should be in SCHIP10 mode for this directive 
  385.     Super Chip-48 V1.1.. spesific directive 
  386.         ; The assembler should be in SCHIP11 mode for this directive 
  387.     Unable to evaluate parameter 
  388.         ; Undefined symbol or bad syntax in expression, value lost 
  389.     Unbalanced condition matching in file 
  390.         ; Count of IFDEF and IFUND not equal to count of ENDIF in file 
  391.     Unused symbol detected 
  392.         ; Symbol defined, but not referenced, perhaps typing mistake 
  393.  
  394. Chipper V2.11 should be invoked with: 
  395.  
  396.     chipper Target [Source] [List] 
  397.  
  398. where Target is destination filename. Source is an optional filename. 
  399. If no source name is specified, the default will be Target.chp. List is 
  400. an optional filename. If no list name is specified, the default will be 
  401. Target.lst. Again, Target is the destination filename. No intelligent 
  402. filename expansion is provided. All filenames should be lower case, and 
  403. include filenames will be forced lower case. Special cases of source 
  404. and list filenames are . for default name, and - for stdin/stdout. The 
  405. list file will contain all error/warning messages, hexdump of all 
  406. generated instructions, a symboltable, an optional symbol cross 
  407. reference, along with defined conditions. 
  408.  
  409. HPASC and STRING mode target files should be transfered as ASCII. HPBIN 
  410. and BINARY output mode target files must be transfered as binary. Use 
  411. kermit for downloading HPASC or HPBIN mode target files to a Hewlett 
  412. Packard 48 series calculator, where the target files will become 
  413. strings. Run the ASC-> program on the HPASC output mode strings, in 
  414. order to make them equal the HPBIN ones. Put a HPBIN mode string on the 
  415. stack, and run the appropriate Chip-48, Super Chip-48 V1.0 or V1.1. 
  416.  
  417. Chipper V2.11 reserves a few conditions for its own mode setting 
  418. purposes. These are manipulated by directives according to the 
  419. following table: 
  420.  
  421.                       A                   S   S       U       X 
  422.                       L       C       H   C   C   U   S   X   R 
  423.                       I   C   H   H   P   H   H   S   E   R   E 
  424.                       G   H   I   P   H   I   I   E   D   E   F 
  425.                       N   I   P   A   E   P   P   D   Y   F   Y 
  426.                       O   P   4   S   A   1   1   O   E   O   E 
  427.                       N   8   8   C   D   0   1   N   S   N   S 
  428.  
  429.     Default           1   0   1   0   1   0   0   0   0   1   1 
  430.  
  431.     ALIGN   OFF       0   .   .   .   .   .   .   .   .   .   . 
  432.     ALIGN   ON        1   .   .   .   .   .   .   .   .   .   . 
  433.     OPTION  BINARY    .   .   .   0   0   .   .   .   .   .   . 
  434.     OPTION  CHIP8     .   1   1   0   0   0   0   .   .   .   . 
  435.     OPTION  CHIP48    .   0   1   .   1   0   0   .   .   .   . 
  436.     OPTION  HPASC     .   .   .   1   1   .   .   .   .   .   . 
  437.     OPTION  HPBIN     .   .   .   0   1   .   .   .   .   .   . 
  438.     OPTION  SCHIP10   .   0   0   .   1   1   0   .   .   .   . 
  439.     OPTION  SCHIP11   .   0   0   .   1   1   1   .   .   .   .  
  440.     OPTION  STRING    .   .   .   1   0   .   .   .   .   .   . 
  441.     USED    NO        .   .   .   .   .   .   .   .   0   .   . 
  442.     USED    OFF       .   .   .   .   .   .   .   0   .   .   . 
  443.     USED    ON        .   .   .   .   .   .   .   1   .   .   .  
  444.     USED    YES       .   .   .   .   .   .   .   .   1   .   . 
  445.     XREF    NO        .   .   .   .   .   .   .   .   .   .   0 
  446.     XREF    OFF       .   .   .   .   .   .   .   .   .   0   . 
  447.     XREF    ON        .   .   .   .   .   .   .   .   .   1   . 
  448.     XREF    YES       .   .   .   .   .   .   .   .   .   .   1 
  449.  
  450. Differences from Chipper V1.12: 
  451.  
  452.     *  Written in C, in order to run on a broader range of computers. 
  453.        This, unfortunately, makes the program potentially more 
  454.        unstable, because of extensive use of pointers. 
  455.  
  456.     *  The order of the command line parameters has changed to target, 
  457.        source and list files. If no source and/or list file names are 
  458.        given, these are derived from the target name by unintelligently 
  459.        adding MS-DOS like file extensions. 
  460.  
  461.     *  Entirely noninteractive. All communication into Chipper V2.11 
  462.        takes place on the command line or in the sourcefiles. There is 
  463.        no special mode to ask for filenames. 
  464.  
  465.     *  Support for Chip-8, Chip-48, Super Chip-48 V1.0 and V1.1 with  
  466.        illegal opcode warnings and different assembler modes. 
  467.  
  468.     *  New directives for mode control and conditional assembly. 
  469.  
  470.     *  Several target file output modes, including ASC-> format. 
  471.  
  472.     *  Multiple pass forward referencing of symbols before use. 
  473.  
  474.     *  Improved warning system, with more accurate information, 
  475.        additional messages, and new list file format, including symbol 
  476.        cross reference listing. 
  477.  
  478. Chipper V2.11 has been tested on a small number of Kernighan-Ritchie C, 
  479. ANSI C and C++ compilers, running on a limited range of the most 
  480. widespread personal computer and workstation operating systems 
  481. available today. The program has to my knowledge behaved reasonably, 
  482. and produced the desired code. A lot of effort has gone into making 
  483. the assembler stable and portable, but I am by no means an experienced 
  484. C programmer, so do not make any assumption that this program should 
  485. run flawlessly, or even run at all, on your computer system. If your C  
  486. compiler has an ANSI mode, enable it when compiling Chipper V2.11. If  
  487. your C compiler/linker imposes memory constraints on the resulting  
  488. program, make sure that the data storage area is allowed to grow past 
  489. 64k bytes. This makes the compact memory model ideal for compilation on 
  490. IBM PC compatibles. The following command line should enable compact 
  491. model, ansi compatibility and optimization for time on the likes of 
  492. Microsoft C V6.00 for MS-DOS:  
  493.  
  494.     cl /AC /Za /Ot chipper.c 
  495.  
  496. The evolution of Chipper V2.11: 
  497.  
  498.     V1.00:  2/11-'90 .. 4/11-'90 
  499.  
  500.         Written in Turbo Pascal V5.5, for MS-DOS 
  501.         Full Chipper V1.12 instruction set and directives 
  502.         No expression parser, only numeric assignment 
  503.         Assembled the symbolic part of Roy Trevino's Zyzygy listfile 
  504.  
  505.     V1.10:  5/11-'90 .. 5/11-'90 
  506.  
  507.         Expression parser added 
  508.         Current assembly address valid in expressions 
  509.         Nondeterministic bugs during expression evaluation 
  510.  
  511.     V1.11:  6/11-'90 .. 7/11-'90 
  512.  
  513.         Expression parser completely rewritten 
  514.         Fixed bug in current assembly address evaluation 
  515.         Assembled parts of Blinky V1.00: 7/11-'90 .. 11/11-'90 
  516.  
  517.     V1.12:  7/11-'90 .. 7/11-'90 
  518.  
  519.         Cosmetic changes only 
  520.         First official version, released on various ftp sites 
  521.         Assembled the completed Blinky V1.00 
  522.         Used for assembling Blinky V1.01: 7/6-'91 .. 7/6-'91 
  523.         Source language of several good Chip-48 games 
  524.  
  525.     V1.13:  10/7-'91 .. 29/7-'91 
  526.  
  527.         First Kernighan-Ritchie C version, tested on SCO Xenix 
  528.         Very close to V1.12 in syntax and functionality 
  529.         May dump core because of string copy overflows 
  530.         New list file format, allows use of stdin/stdout 
  531.  
  532.     V2.00:  29/7-'91 .. 19/8-'91 
  533.  
  534.         Tested on various cc, gcc, g++, msc, tc and bc compilers 
  535.         Tested under MS-DOS, UNIX, Xenix and OS/2 operating systems 
  536.         New instructions, directives and error messages 
  537.         Several output file formats, conditions, cross referencing 
  538.         Multiple pass forward referencing of symbols in expressions 
  539.         Assembled the completed Blinky V2.00: 17/8-'91 .. 18/8-'91  
  540.  
  541.     V2.10:  19/8-'91 .. 19/8-'91 
  542.  
  543.         Identical to V2.00 in syntax and functionality 
  544.         Reduces memory fragmentation by using block allocations 
  545.         Requires 30% less available memory than V2.00 
  546.  
  547.     V2.11:  20/8-'91 .. 20/8-'91 
  548.  
  549.         Identical to V2.10 in syntax and functionality 
  550.         Second official version, released on comp.sources.hp48 
  551.         Handles carriage return in ASC-> output format on MS-DOS 
  552.  
  553. Thank you, to all who have used Chipper V1.12, played Blinky, and/or 
  554. taken interest in porting Chipper to new platforms. It feels good to 
  555. know that people actually use my programs once in a while. May all 
  556. HP48 users enjoy their Chip-48 games for a long time to come.. 
  557.  
  558. This document contains some information more or less copied directly 
  559. off the Chip-48 documentation by Andreas Gustafsson, and off the 
  560. Super Chip-48 documentation by Erik Bryntse. These two have done a 
  561. great job, hacking for the HP48SX. The Chipper V2.11 syntax is a slight 
  562. extension of the V1.12 original. This was in turn inspired by the 
  563. Syzygy game listing posted to comp.sys.handhelds by Roy Trevino. Syzygy 
  564. is still a great Chip-48 game. 
  565.  
  566. Chip-48 is (C) Copyright 1990 Andreas Gustafsson. 
  567. Super Chip-48 V1.0 and V1.1 are modifications made by Erik Bryntse. 
  568. Chipper V2.11 is (C) Copyright 1991 Christian Egeberg. 
  569.  
  570. Noncommercial distribution allowed, provided that copyright messages 
  571. are preserved, and any modified versions are clearly marked as such. 
  572.  
  573. Chip-48, its successors, and because of that, programs written in 
  574. Chipper make use of undocumented low-level features of the Hewlett 
  575. Packard 48 series calculator. They may or may not cause loss of data, 
  576. excessive battery drainage, and/or damage to the calculator hardware. 
  577. The authors take no responsibility whatsoever for any damage caused 
  578. by the use of these programs. 
  579.  
  580. The authors takes no responsibility for loss of data, damage to any 
  581. personal computer or workstation hardware and/or software, nor strange 
  582. incidents caused by the use of these programs. 
  583.  
  584. This software is provided "as is" and without any express or implied 
  585. warranties, including, but not limited to, the implied warranties of 
  586. merchantability and fitness for a particular purpose. 
  587.